<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>协议</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>系统管理&gt;&gt;协议管理
    </div>
<div class="xt_main_right_center">
<form name="searchForm" id="searchForm" method="post" action="index.do">
  <table  width="100%" border="0" cellpadding="0" cellspacing="0"    style="border-color:#CCCCCC;"  >
    <tr>
      <td class="left-td-width-bg" >协议编号：</td>
      <td class="right-td-width-bg-left" ><label>
        <input type="text" name="treatyDTO.identifier" class="input"  id="textfield" value="${ treatyDTO.identifier}">
      </label></td>
      <td class="left-td-width-bg" >金融机构：</td>
      <td class="right-td-width-bg-left" >
      	<select class="input"  name="treatyDTO.financial.id" id="financialId">
         <option value="">*****请选择*****</option>
        <s:iterator value="listFinancials" status="i" id="b">
          <option <s:if test='treatyDTO.financial.id==#b.id'>selected="selected"</s:if> value="${b.id }">${b.name }</option>
          </s:iterator>
        </select>
      	
      	<!-- <input class="input"  type="text" name="treatyDTO.branch" value="${treatyDTO.branch }" id="textfield4"> -->
      	
      	</td>
      <td class="left-td-width-bg" >收取方式：</td>
      <td class="right-td-width-bg-left" ><select class="input"  name="treatyDTO.collectionWay" id="select2">
        <option value="" >请选择</option>
        <option <s:if test='treatyDTO.collectionWay.equals("0")'>selected="selected"</s:if>   value="0" >月付</option>
        <option <s:if test='treatyDTO.collectionWay.equals("1")'>selected="selected"</s:if>    value="1" >季付</option>
        <option <s:if test='treatyDTO.collectionWay.equals("2")'>selected="selected"</s:if>  value="2" >半年付</option>
      </select></td>
    </tr>
    <tr>
      <td  class="left-td-width-bg" >店名：</td>
      <td class="right-td-width-bg-left" ><input class="input"  type="text" name="treatyDTO.shop.shopName" value="${treatyDTO.shop.shopName }" id="textfield2"></td>
      <td  class="left-td-width-bg" >管理费范围：</td>
      <td ><table width="100%" border="0">
        <tr>
          <td><input class="input"  name="floorsD" value="${floorsD }" type="text" id="textfield3" size="8"></td>
          <td>至</td>
          <td><input name="floorsX" value="${floorsX }" class="input"  type="text" id="floorsX" size="8"></td>
          </tr>
</table></td>
 	  <td  class="left-td-width-bg" >协议版本：</td>
      <td class="right-td-width-bg-left" >
      <select class="input"  name="versionMark" id="select2">
        <option value="" >请选择</option>
        <option <s:if test='versionMark == "true"'>selected="selected"</s:if>   value="true">新签</option>
        <option <s:if test='versionMark == "false"'>selected="selected"</s:if>    value="false" >续签</option>
      </select></td>
      </tr>
      <tr>
      <td class="left-td-width-bg" >销售店号</td>
      <td  colspan="5" class="right-td-width-bg-left" ><input class="input"  type="text" name="treatyDTO.shop.shopMark" value="${treatyDTO.shop.shopMark }" id="textfield2"></td>
      </tr>
       <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
      <td colspan="6" align="right" style="border-bottom:none;"><label>
      <input type="submit" name="button" id="button" class="btn_query" value="">
        <input type="reset" name="button" onClick="clearForm(this.form);return false;" class="btn_clear_form"  id="button" value="">
      </label></td>
      </tr>
    
  </table>
  </form>
</div>
  <table width="100%" border="0">
    <tr>
      <td align="right">&nbsp;</td>
      <td align="right"></td>
    </tr>
    <tr>
      <td align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
      
      <td align="right">
      <jysz:permission code="SYS_TREATY_IMPORT">
      <a href="javascript:importa()"><img src="${contextPath}/images/import.png" alt="导入协议信息" /></a>&nbsp;&nbsp;&nbsp;&nbsp;</jysz:permission>
      <jysz:permission code="SYS_TREATY_ADD">
      <a href="javascript:add()"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a>
      </jysz:permission>
      </td>
    </tr>
  </table>
  <table  width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td class="top-td-width-bg">序号</td>
      <td class="top-td-width-bg">店号</td>
      <td class="top-td-width-bg">店名</td>
      <td class="top-td-width-bg">协议编号</td>
      <td class="top-td-width-bg">协议对象</td>
      <td class="top-td-width-bg">合作银行</td>
      <td class="top-td-width-bg">费用收取方式</td>
      <td class="top-td-width-bg">管理费标准</td>
      <td class="top-td-width-bg">客户经理</td>
      <td class="top-td-width-bg">签订时间</td>
      <td class="top-td-width-bg">结束时间</td>
      <td class="top-td-width-bg">客户经理电话</td>
      <td class="top-td-width-bg">客户经理邮箱</td>
      <td class="top-td-width-bg">状态</td>
      <td class="top-td-width-bg">是否有存底</td>
      <td class="top-td-width-bg">协议版本</td>
      <td class="top-td-width-bg">创建时间</td>
      <td class="top-td-width-bg">更新时间</td>
      <td class="top-td-width-bg">操作</td>
    </tr>
    <s:iterator value="page.result" status="i" id="p">
    <tr>
      <td class="down-center-td-width-bg">${i.count }</td>
      <td class="down-center-td-width-bg">${p.shop.shopMark }</td>
      <td class="down-left-td-width-bg">${p.shop.shopName }</td>
      <td class="down-left-td-width-bg">${p.identifier }</td>
      <td class="down-left-td-width-bg">${p.financial.name}</td>
      <td class="down-left-td-width-bg">${p.branch }</td>
      <td class="down-center-td-width-bg"> 
      <s:if test='#p.collectionWay.equals("0")'>月付</s:if>
      <s:elseif test='#p.collectionWay.equals("1")'>季付</s:elseif>
      <s:elseif test='#p.collectionWay.equals("2")'>半年付</s:elseif></td>
      <td class="down-right-td-width-bg"><s:property value="formatAmount(#p.floors)"/></td>
      <td class="down-center-td-width-bg">${p.manager}</td>
      <td class="down-center-td-width-bg"><s:date name="#p.startDate" format="yyyy-MM-dd"/></td>
      <td class="down-center-td-width-bg"><s:date name="#p.endDate" format="yyyy-MM-dd"/></td>
      <td class="down-left-td-width-bg">${p.conductorPhone}</td>
      <td class="down-left-td-width-bg">${p.conductorEmile}</td>
      <td class="down-center-td-width-bg"><s:if test='#p.state==true'>启用</s:if>
      <s:elseif test='#p.state==false'>禁用</s:elseif></td>
      <td class="down-center-td-width-bg"><s:if test='#p.foreignReserves.equals("0")'>是</s:if>
      <s:elseif test='#p.foreignReserves.equals("1")'>返还</s:elseif>
       </td>
       <td class="down-center-td-width-bg"><s:if test="#p.mark == true">新签</s:if><s:else>续签</s:else></td>
       
      <td class="down-center-td-width-bg"><s:date name="#p.createdAt" format="yyyy-MM-dd"/></td>
      <td class="down-center-td-width-bg"><s:date name="#p.updatedAt" format="yyyy-MM-dd"/></td>
      
      <td class="down-center-td-width-bg">
      <jysz:permission code="SYS_TREATY_EDIT">
      <a href="javascript:update(${p.id })" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
      </jysz:permission>
      </td>
    </tr>
    </s:iterator>
    <tr>
      <td class="down-center-td-width-bg"  colspan="19" align="right"> <%@ include file="/WEB-INF/view/common/pagination.jsp"%></td>
    </tr>
  </table>
<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
  <p>&nbsp;</p>

<script type="text/javascript">
		function jumpPage(page) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/system/treaty/index.do?currentPage=" + page;
			searchForm.submit();
		} 
function add(){
	var searchForm = document.searchForm;
	searchForm.action = "add.do?currentPage=${currentPage}";
	searchForm.submit();
}
function importa(){
	var searchForm = document.searchForm;
	searchForm.action = "toImport.do?currentPage=${currentPage}";
	searchForm.submit();
	}
	function update(id){
		var searchForm = document.searchForm;
		searchForm.action = "minute.do?currentPage=${currentPage}&treaty.id="+id;
		searchForm.submit();
	}
</script>
</body>
</html>